#ifndef IDLEDETECTOR_H
#define IDLEDETECTOR_H

#include <QPoint>
#include <QLabel>

/* Simple class to detect if the user is at the computer or not (by monitoring mouse movement)*/
class IdleDetector : public QLabel {
	Q_OBJECT;
	public:
		IdleDetector(int idleSeconds, QWidget* parent = 0);
		void setEnabled(bool on);
	protected:
		void timerEvent(QTimerEvent* evt);
		void mousePressEvent(QMouseEvent* event);
	signals:
		void idle();
	private:
		QPoint lastMousePosition;
		bool userIdle;
		bool enabled;
		int measurementsLeft;
};

#endif // IDLEDETECTOR_H
